package com.miracle9.game.dao;
import com.miracle9.game.bean.Pager;
import com.miracle9.game.entity.DeskResult;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

@Repository
public class DeskResultServiceDao extends SqlOperating<DeskResult, Integer>
{
  public Pager getByDeskId(int deskId, String startDate, String endDate, Pager pager)
  {
    return q_CreateSqlsPager("from DeskResult where deskId = ? and datetime>=? and datetime<?", pager, new Object[] { Integer.valueOf(deskId), 
      startDate, endDate });
  }
  
  public void deletePastResult(String date)
  {
	  q_CreateSql("delete from DeskResult where datetime<?", new Object[] { date }).executeUpdate();
  }
}
